﻿using AnjLab.SyncIT.Core.Api;

namespace AnjLab.SyncIT.Core.Data.GoogleCode
{
    public class GoogleCodeProvider: Provider
    {
        public override bool HasPassword
        {
            get { return false; }
        }

        public override string Icon
        {
            get { return @"resources\google_icon.jpg"; }
        }

        public override ISourceTaskDao CreateTaskDao(Source source)
        {
            return new GoogleCodeIssueDao(source);
        }

        public override string GetMyTasksUrl(Source source)
        {
            return GetActiveTasksUrl(source) + "?q=Owner%3D" + source.UserName;
        }

        public override string GetActiveTasksUrl(Source source)
        {
            return "http://code.google.com/p/" + source.ProjectBase + "/issues/list";
        }

        public override string GetProjectBaseHint(Source source)
        {
            return "Specify your Google Code project name, e.g.: outlooktrac";
        }

        public override string DefaultOutlookItemBodyTemplate
        {
            get
            {
                return
                    @"
Issue #ID#: #Summary#
http://code.google.com/p/#ProjectBase#/issues/detail?id=#ID#

#Stars# Stars
Owner: #Owner#
Status: #Status#
Reported by #Reporter# at #Opened#
CC: #CC#
Labels: #LabelsAsText#
Modified: #Modified#

#Description#
#AttachmentsAsText#";
            }
        }
    }
}
